#pragma once

#include <iostream>
#include <iomanip>
#include <sys/time.h>

std::string get_time()
{
    struct timeval currentTime;
    gettimeofday(&currentTime, nullptr);

    // 将秒数转换为时间格式
    time_t seconds = currentTime.tv_sec;
    struct tm *localTime = localtime(&seconds);

    // 将时间格式转换为字符串
    char buffer[80];
    strftime(buffer, 80, "%m-%d %H:%M:%S", localTime);

    return buffer;
}